public class ThreadTest1 {
    public static void test() {

        InnerTest inner = new InnerTest();

        for (int i = 0; i < 10; i++) {

            System.out.println(System.currentTimeMillis() + " " + System.identityHashCode(inner) + " " +
                    System.identityHashCode(inner.local) + " " +
                    inner.local + " " + Thread.currentThread().getName() + " before ");
            inner.local = i+0.0;
            System.out.println(System.currentTimeMillis() + " " + System.identityHashCode(inner) + " " +
                    System.identityHashCode(inner.local) + " " +
                    inner.local + " " + Thread.currentThread().getName() + " after ");

            new Thread(new Runnable() {

                @Override
                public void run() {

                    System.out.println(System.currentTimeMillis() + " " + System.identityHashCode(inner) + " " +
                            System.identityHashCode(inner.local) + " " +
                            inner.local + " " + Thread.currentThread().getName()+" before ");
                    inner.local  += 100;
                    System.out.println(System.currentTimeMillis() + " " + System.identityHashCode(inner) + " " +
                            System.identityHashCode(inner.local) + " " +
                            inner.local + " " + Thread.currentThread().getName() + " after ");

                }
            }).start();
        }

    }
    private static class InnerTest {
        Double local = 100.0;
        InnerTest() {

        }
    }

    public static void main(String[] args) {
        test();
    }
}
